﻿using FluentValidation;

namespace Core.Identity.Tokens.Features.Generate;

/// <summary>
/// 生成Token
/// </summary>
/// <param name="Username">用户名</param>
/// <param name="Password">密  码</param>
public record TokenGenerationCommand( string Username, string Password);

public class GenerateTokenValidator : AbstractValidator<TokenGenerationCommand>
{
    public GenerateTokenValidator()
    {
        RuleFor(p => p.Username).Cascade(CascadeMode.Stop).NotEmpty();

        RuleFor(p => p.Password).Cascade(CascadeMode.Stop).NotEmpty();
    }
}
